<?php
/**
 * @package WordPress
 * @subpackage Starkers
 */
?>
<div id="action">
<div class="tabs">
<?php
	global $post;
	$postID = $post->ID;
$content = get_post_meta($postID, 'post-name', true);
$args = array(
	'tag' => $content,
	'category_name' => 'Sidebar'
);
	query_posts($args);
 ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>	
<a href="<?php 
global $post;
$postID = $post->ID;
$postgotoID = get_post_meta($postID, 'pageID', true);
if ( empty($postgotoID) ) {
$posttitle = $post->post_title;
$page = get_page_by_title( $posttitle );
$page_id = $page->ID;
$link = get_page_link($page_id);
echo $link;
} 
else {
$link = get_page_link($postgotoID);
echo $link;
}
?>">
<?php
global $post;
$content = $post->post_content;
echo $content
?></a>
<?php endwhile; endif; ?>
</div>

<?php wp_reset_query(); ?>
<div class="list">
	<h3><?php echo get_post_meta('71', 'home-lawyers', true) ?></h3>
	<ul id="slider-2" class='home'>
		<?php query_posts('category_name=lawyers'); ?>
		<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>		
		
		<li><img title="#<?php echo get_post_meta($post->ID, 'slider-name', true) ?>" src="<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
<?php echo $image[0]; ?>
<?php endif; ?>" />
<div id="<?php echo get_post_meta($post->ID, 'slider-name', true) ?>" class="nivo-html-caption"><span class="title"><?php echo the_title(); ?></span><?php echo get_the_content(); ?> <a href="<?php echo get_permalink($post->ID); ?>"><?php echo get_post_meta($post->ID, 'read-on-link', true) ?></a></div></li>
			
			
	
		<?php endwhile; endif; ?>
	</ul>
</div>
</div><!-- action -->
		